Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support db_securityadmin #100

Merged
merged 8 commits into from
Oct 31, 2024
Merged

Conversation

HarshLunagariya
Copy link

@HarshLunagariya HarshLunagariya commented Oct 20, 2024

Description

Extension PR : amazon-aurora/babelfish_extensions#70

Issues Resolved

BABEL-5135

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Harsh Lunagariya <[email protected]>
Signed-off-by: Harsh Lunagariya <[email protected]>
Signed-off-by: Harsh Lunagariya <[email protected]>
src/backend/catalog/aclchk.c Show resolved Hide resolved
Comment on lines 55 to 58
static char *default_bbf_db_principals =
"('master_dbo', 'master_db_owner', 'master_guest', 'master_db_accessadmin', "
"'msdb_dbo', 'msdb_db_owner', 'msdb_guest', 'msdb_db_accessadmin', "
"'tempdb_dbo', 'tempdb_db_owner', 'tempdb_guest', 'tempdb_db_accessadmin') ";
"('master_dbo', 'master_db_owner', 'master_guest', 'master_db_accessadmin', 'master_db_securityadmin', "
"'msdb_dbo', 'msdb_db_owner', 'msdb_guest', 'msdb_db_accessadmin', 'msdb_db_securityadmin', "
"'tempdb_dbo', 'tempdb_db_owner', 'tempdb_guest', 'tempdb_db_accessadmin', 'tempdb_db_securityadmin') ";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of updating this static list everytime, is it possible to get this list dynamically using some query during dump? same is applicable for default_bbf_roles

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be possible IMO, We can rely on the is_fixed_role metadata. Currently, we are not utilizing it and not even updating it for fixed roles.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets open internal jira to track this work.

@@ -1992,7 +1992,7 @@ dumpBabelPhysicalDatabaseACLs(Archive *fout)
"\n SET LOCAL ROLE sysadmin;"
"\n FOR rolname, original_name IN ("
"\n SELECT a.rolname, a.orig_username FROM sys.babelfish_authid_user_ext a"
"\n WHERE orig_username IN ('dbo','db_accessadmin') AND"
"\n WHERE orig_username IN ('dbo','db_accessadmin','db_securityadmin') AND"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redeisgn/rethink this query so that we dont need to re-write this everytime

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be backward compatible, so this will be an interesting challenge

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need @rishabhtanwar29 's opinion on this.

@@ -53,9 +53,15 @@ typedef enum {
static babelfish_status bbf_status = NONE;

static char *default_bbf_db_principals =

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnt this list the same as default_bbf_roles defined in other file?

@tanscorpio7 tanscorpio7 force-pushed the server-database-roles-4-x branch from f5618f3 to 46ac851 Compare October 25, 2024 11:58
@tanscorpio7 tanscorpio7 merged commit 16084d5 into server-database-roles-4-x Oct 31, 2024
4 checks passed
tanscorpio7 pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Oct 31, 2024
Description
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
BABEL-5135

Signed-off-by: Harsh Lunagariya <[email protected]>
tanscorpio7 pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Oct 31, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
tanscorpio7 pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Oct 31, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
tanscorpio7 pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Oct 31, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
tanscorpio7 pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Oct 31, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
tanscorpio7 pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Nov 1, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
tanscorpio7 pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Nov 5, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit that referenced this pull request Nov 15, 2024
Description
Handle babelfish dump restore changes for fixed database role db_securityadmin
Extension PR : amazon-aurora/babelfish_extensions#70

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Nov 15, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Nov 15, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Nov 15, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
thephantomthief pushed a commit that referenced this pull request Nov 20, 2024
Description
Handle babelfish dump restore changes for fixed database role db_securityadmin
Extension PR : amazon-aurora/babelfish_extensions#70

Signed-off-by: Harsh Lunagariya <[email protected]>
thephantomthief pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Nov 20, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
thephantomthief pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Nov 20, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit that referenced this pull request Dec 5, 2024
Description
Handle babelfish dump restore changes for fixed database role db_securityadmin
Extension PR : amazon-aurora/babelfish_extensions#70

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Dec 5, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Dec 12, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Dec 12, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
shardgupta pushed a commit to babelfish-for-postgresql/babelfish_extensions that referenced this pull request Dec 12, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
chxwang pushed a commit that referenced this pull request Dec 12, 2024
Description
Handle babelfish dump restore changes for fixed database role db_securityadmin
Extension PR : amazon-aurora/babelfish_extensions#70

Signed-off-by: Harsh Lunagariya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants